package com.flying.inherit.inheritanceTest5;

/**
 * @ClassName: Test5
 * @createDate: 2023/6/27 20:52
 * @author: liu
 * @description:子类重写了get和set方法
 */
public class Test5 {
    public static void main(String[] args) {
        Father f=new Father();
        Son s=new Son();

        System.out.println(s.getInfo());  //  大硅谷

        s.setInfo("尚硅谷");
        System.out.println(s.getInfo());   // 尚硅谷

        Object o= new Object();

    }



}

class Father extends Object{
    private String info="atguigu";
    public void setInfo(String info){
        this.info=info;
    }

}

class Son extends Father {
    private String info="大硅谷";


    public String getInfo() {
        return  info;
    }

    @Override
    public void setInfo(String info) {
        this.info = info;
    }
    public void test(){
    }



}
